﻿@{
    var propertyName = Model.PropertyName != null ? (string)Model.PropertyName : "Text";
    var htmlAttributes = (Dictionary<string, object>)Model.HtmlAttributes;

    if (htmlAttributes == null) {
        htmlAttributes = new Dictionary<string, object>();
    }

    if (Model.Required == true) {
        htmlAttributes["required"] = "required";
    }

    if (Model.AutoFocus == true) {
        htmlAttributes["autofocus"] = "autofocus";
    }

    if (!String.IsNullOrEmpty(Model.Placeholder)) {
        htmlAttributes["placeholder"] = Model.Placeholder;
    }
}

@Html.TextArea(propertyName, (string)Model.Text, 25, 80, htmlAttributes)